package cn.lu.train.mvp.model;

import cn.lu.train.mvp.view.IBaseView;

public abstract class CallbackImpl<T, V extends IBaseView> implements Callback<T> {

    protected V mView;

    public CallbackImpl(V view) {
        if (view == null) {
            throw new IllegalArgumentException("argument is not null");
        }
        this.mView = view;
        this.mView.onLoading();
    }

    @Override
    public void onError(Throwable e) {
        mView.onError(e);
    }

    @Override
    public void onComplete() {
        mView.onComplete();
    }
}
